import {
  DashboardOutlined,
  UserOutlined,
  DatabaseOutlined,
  RobotOutlined,
  SolutionOutlined,
  SettingOutlined,
  BarChartOutlined,
  ShakeOutlined,
  UsergroupAddOutlined,
  MessageOutlined,
  ContactsOutlined,
  FileDoneOutlined,
  SendOutlined,
  NodeIndexOutlined,
  AimOutlined,
  CloudUploadOutlined,
  PhoneOutlined,
} from '@ant-design/icons';

// 菜单配置:不区分权限
const siderBarConfig = [
  {
    name: '首页',
    icon: DashboardOutlined,
    path: '/webapp/homePage',
  },
  {
    name: '行业短信',
    icon: ShakeOutlined,
    path: '/webapp/industrySms',
    children: [
      {
        name: '短信群发',
        icon: UsergroupAddOutlined,
        path: '/webapp/industrySms/MassSMS',
      },
      {
        name: '下发回复记录',
        icon: MessageOutlined,
        path: '/webapp/industrySms/ReplyRecord',
      },
      {
        name: '通讯录',
        icon: ContactsOutlined,
        path: '/webapp/industrySms/AddressBook',
      },
      {
        name: '模板列表',
        icon: FileDoneOutlined,
        path: '/webapp/industrySms/TemplateList',
      },
      {
        name: '发送记录',
        icon: SendOutlined,
        path: '/webapp/industrySms/SendRecord',
      },
      {
        name: '批次记录',
        icon: NodeIndexOutlined,
        path: '/webapp/industrySms/BatchRecord',
      },
    ],
  },
  {
    name: '靶向短信',
    icon: AimOutlined,
    path: '/webapp/targetSms',
    children: [
      {
        name: '靶向综合发布管理',
        icon: CloudUploadOutlined,
        path: '/webapp/targetSms/TargetRelease',
      },
      {
        name: '模板列表',
        icon: FileDoneOutlined,
        path: '/webapp/targetSms/TargetTemplate',
      },
      {
        name: '发送记录',
        icon: SendOutlined,
        path: '/webapp/targetSms/TargetSend',
      },
    ],
  },
  {
    name: '智能外呼',
    icon: PhoneOutlined,
    path: '/webapp/outbound',
    children: [
      {
        name: '任务管理',
        icon: DatabaseOutlined,
        path: '/webapp/outbound/task',
        children: [
          {
            name: '外呼任务',
            path: '/webapp/outbound/task/callTask',
          },
        ],
      },
      {
        name: 'AI管理',
        icon: RobotOutlined,
        path: '/webapp/outbound/ai',
        children: [
          {
            name: '机器人管理',
            path: '/webapp/outbound/ai/robots',
          },
          {
            name: '通知流程管理',
            path: '/webapp/outbound/ai/notifyFlows',
          },
        ],
      },
      {
        name: '客户管理',
        icon: SolutionOutlined,
        path: '/webapp/outbound/client',
        children: [
          {
            name: '号码属性管理',
            path: '/webapp/outbound/client/numAttr',
          },
          {
            name: '号码组管理',
            path: '/webapp/outbound/client/numGroup',
          },
          {
            name: '黑名单管理',
            path: '/webapp/outbound/client/blackList',
          },
          {
            name: '白名单管理',
            path: '/webapp/outbound/client/whiteList',
          },
        ],
      },
      {
        name: '系统配置',
        icon: SettingOutlined,
        path: '/webapp/outbound/system',
        children: [
          {
            name: '资源池管理',
            path: '/webapp/outbound/system/resourcePool',
          },
          {
            name: '主叫号码管理',
            path: '/webapp/outbound/system/mainNum',
          },
          {
            name: '号码解密',
            path: '/webapp/outbound/system/phoneTranslate',
          },
        ],
      },
    ],
  },
  {
    name: '能力申请',
    icon: UserOutlined,
    path: '/webapp/cas/abilities',
  },
  {
    name: '签名管理',
    icon: UserOutlined,
    path: '/webapp/cas/signatures',
  },
  {
    name: '模版管理',
    icon: UserOutlined,
    path: '/webapp/cas/templates',
  },
  {
    name: '数据统计',
    icon: BarChartOutlined,
    path: '/webapp/casStatistics',
    children: [
      {
        name: '行业短信',
        icon: BarChartOutlined,
        path: '/webapp/casStatistics/industrySms',
      },
      {
        name: '靶向短信',
        icon: BarChartOutlined,
        path: '/webapp/casStatistics/targetedSms',
      },
      {
        name: '智能外呼',
        icon: BarChartOutlined,
        path: '/webapp/casStatistics/intelligentCall',
      },
      {
        name: '计费统计',
        icon: BarChartOutlined,
        path: '/webapp/casStatistics/billing',
      },
    ],
  },
  {
    name: '系统管理',
    icon: SettingOutlined,
    path: '/webapp/casSystem',
    children: [
      {
        name: '单位管理',
        icon: UserOutlined,
        path: '/webapp/casSystem/organizations',
      },
      {
        name: '角色管理',
        icon: UserOutlined,
        path: '/webapp/casSystem/roles',
      },
      {
        name: '用户管理',
        icon: UserOutlined,
        path: '/webapp/casSystem/users',
      },
      {
        name: '敏感词管理',
        icon: UserOutlined,
        path: '/webapp/casSystem/sensitiveWord',
      },
      {
        name: 'API令牌管理',
        icon: UserOutlined,
        path: '/webapp/casSystem/apiToken',
      },
      {
        name: '操作日志',
        icon: UserOutlined,
        path: '/webapp/casSystem/operationLog',
      },
    ],
  },
];

// 系统一级菜单:不区分权限
const systemOneLeverMenu: any = [];
// 系统面包屑:不区分权限
const breadcrumbNameMap: { [key: string]: string } = {
  // 特殊：不在左侧菜单列表展示的路径
  // '/webapp/account/role/permission': '功能权限',
  '/webapp/outbound/task/callTask/detail': '任务详情',
  '/webapp/outbound/ai/robots/version/flow': '配置话术流程',
  '/webapp/outbound/ai/notifyFlows/notifySoundLibrary': '录音库',
  // '/webseats/seats/soundManage/soundLibrary': '录音库',
  // '/webapp/account/seatGroup/adjust': '坐席调整',
  // '/webapp/enterpriseBill/recharge': '充值记录',
};
// 遍历左侧菜单栏，生成一级菜单，面包屑
siderBarConfig.length &&
  siderBarConfig.forEach(item => {
    systemOneLeverMenu.push(item.path);
    breadcrumbNameMap[item.path] = item.name;
    // 遍历二级菜单
    item.children?.length &&
      item.children.forEach(child => {
        breadcrumbNameMap[child.path] = child.name;
      });
  });

export { siderBarConfig, systemOneLeverMenu, breadcrumbNameMap };
